package com.air.designmodel.thirteen;

/**
 * 组合模式测试类
 *
 * @author shent
 */
public class Test {
    public static void main(String[] args) {
        MenuComponent pancakeMenu = new Menu("pancakeMenu", "this is pancakeMenu");
        MenuComponent dinerMenu = new Menu("dinerMenu", "this is dinerMenu");
        MenuComponent cafeMenu = new Menu("cafeMenu", "this is cafeMenu");

        MenuComponent allMenu = new Menu("allMenu", "this is allMenu");
        allMenu.add(pancakeMenu);
        allMenu.add(dinerMenu);
        allMenu.add(cafeMenu);

        dinerMenu.add(new MenuItem("Pasta", "this is Pasta", true, 3.89));

        Waitress waitress = new Waitress(allMenu);
        waitress.printMenu();
        waitress.printVegetarianMenu();
    }

}
